<script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
<div id="content-container" class="container">
    <div class="user-section login-section">
        <div class="logon-tab clearfix"> 
            <a href="{:url('user/login')}?url={$url|urlencode}">{:__('Sign in')}</a> 
            <a class="active">{:__('Wechat in')}</a>
            <a href="{:url('user/register')}?url={$url|urlencode}">{:__('Sign up')}</a> </div>
        <div class="login-main"> 
            {if get_addon_info('wxlogin')}
                <div id="login_container"></div>
            {else/}
                <div class="no-addon">需要安装《<span>微信扫码登录</span>》 插件</div>
            {/if}
        </div>
    </div>
</div>
<script>
    var obj = new WxLogin({
        id: "login_container",
        appid: "{:$appid}",
        scope: "snsapi_login",
        redirect_uri: encodeURIComponent('{$base_url}addons/wxlogin/index/login'), 
        state: Math.ceil(Math.random()*1000),
        style: "black",
        href: "data:text/css;base64,QGNoYXJzZXQgIlVURi04IjsKLmltcG93ZXJCb3ggLnFyY29kZSB7d2lkdGg6IDI4MHB4O30KLmltcG93ZXJCb3ggLnRpdGxlIHtkaXNwbGF5OiBub25lO30KLmltcG93ZXJCb3ggLmluZm8ge3dpZHRoOiAyODBweDt9Ci5zdGF0dXNfaWNvbiB7ZGlzcGxheTogbm9uZX0KLmltcG93ZXJCb3ggLnN0YXR1cyB7dGV4dC1hbGlnbjogY2VudGVyO30g"
    });
</script>